Skip to content

feat: Add Mille Solver - #5954

Open
goblirsc wants to merge 11 commits into
acts-project:mainfrom
goblirsc:MG_MilleSolver
Open

goblirsc wants to merge 11 commits into
acts-project:mainfrom
goblirsc:MG_MilleSolver

Conversation

@goblirsc

@goblirsc goblirsc commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Add a MilleSolver to handle running the MillePede alignment step and collect the results.

Adds a MilleSolver which wraps the call to pede. It allows to redirect the output and returns a struct with the fit status and the location of the output files.

Currently, it expects the user to have already configured the steering file for the fit - this will be handled by one of the next PRs in the ongoing stack, by a separate tool.

The child process call required for this wrapping is currently done via Boost::process. For the longer-term future, a refactor of pede is foreseen to allow running the alignment fit via an API call to a library, rather than having to invoke an external program. Once that becomes available, this wrapper will be replaced accordingly.

The PR also adds python bindings for the solver and its configuration, as well as a unit test.

@github-actions github-actions Bot added the Component - Plugins Affects one or more Plugins label Aug 25, 2026
@github-actions github-actions Bot added this to the next milestone Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Public API surface diff

+22 added, 0 breaking.

➕ Added public API

New types / aliases / enums / variables / concepts (4)
  • enums ActsPlugins::ActsToMille::MillePedeError
  • type ActsPlugins::ActsToMille::MillePedeSolver
  • type ActsPlugins::ActsToMille::MillePedeSolver::Config
  • type ActsPlugins::ActsToMille::MillePedeSolver::mpResult
New call signatures (incl. defaulted-arg overloads) (3)
  • ActsPlugins::ActsToMille::MillePedeSolver::MillePedeSolver()
  • ActsPlugins::ActsToMille::MillePedeSolver::MillePedeSolver(Acts::Logging::Level)
  • ActsPlugins::ActsToMille::MillePedeSolver::solve(const Config &) const
New public data members (15)
  • ActsPlugins::ActsToMille::MillePedeSolver::Config::evFileName
  • ActsPlugins::ActsToMille::MillePedeSolver::Config::extraOpts
  • ActsPlugins::ActsToMille::MillePedeSolver::Config::histoFileName
  • ActsPlugins::ActsToMille::MillePedeSolver::Config::logFileName
  • ActsPlugins::ActsToMille::MillePedeSolver::Config::redirectStdout
  • ActsPlugins::ActsToMille::MillePedeSolver::Config::resFileName
  • ActsPlugins::ActsToMille::MillePedeSolver::Config::steeringFile
  • ActsPlugins::ActsToMille::MillePedeSolver::Config::workDir
  • ActsPlugins::ActsToMille::MillePedeSolver::mpResult::evFile
  • ActsPlugins::ActsToMille::MillePedeSolver::mpResult::exitCode
  • ActsPlugins::ActsToMille::MillePedeSolver::mpResult::exitMessage
  • ActsPlugins::ActsToMille::MillePedeSolver::mpResult::exitStatus
  • ActsPlugins::ActsToMille::MillePedeSolver::mpResult::histoFile
  • ActsPlugins::ActsToMille::MillePedeSolver::mpResult::logFile
  • ActsPlugins::ActsToMille::MillePedeSolver::mpResult::resultsFile

@github-actions github-actions Bot added the Infrastructure Changes to build tools, continous integration, ... label Aug 26, 2026
@goblirsc

Copy link
Copy Markdown
Contributor Author

Two questions to the experts triggered by unit test failures (e.g. lcg_109_alma9_gcc15 (pull_request))

  • if I want to test a case which intentionally emits an ERROR message, how can I prevent this message from triggering a unit test failure?
  • if my unit test depends on a thirdparty executable program (here: pede) compiled during the ACTS build process, can I make the CI unit tests run the "install" step / source the ACTS setup script before running the unit tests, to ensure my program is picked up?

@github-actions github-actions Bot removed Component - Core Affects the Core module Component - Fatras Affects the Fatras module labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

📊: Physics performance monitoring for 66bebd5

Full contents

physmon summary

@goblirsc
goblirsc marked this pull request as ready for review September 22, 2026 08:25
@sonarqubecloud

Copy link
Copy Markdown


namespace ActsPlugins::ActsToMille {

enum class childProcessStatus {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
enum class childProcessStatus {
enum class ChildProcessStatus {

Comment on lines +22 to +27
ok = 0,
progNotFound = 1,
failedRedirectStdout = 2,
failedWorkDir = 3,
failedRun = 4,
unknownError = 5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 100% sure but I think we usually capitalize these too

/// @param runDir: If not empty, will run in the specified directory.
/// Should already exist (caller is responsible).
/// @return a pair with the call outcome and the return code (if any, else -1).
childProcessStatus runChildProcess(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runChildProcess sounds a bit generic but might be fair inside the ActsPlugins::ActsToMille namespace. the header is placed in detail so I think this function should be too? an alternative name could be runMilleExecutable

Comment on lines +36 to +49
std::string steeringFile =
"pedeSteerMaster.txt"; /// steering file with run options
std::filesystem::path workDir = ""; /// directory to run in
std::vector<std::string> extraOpts = {}; /// extra CLI options
std::string resFileName =
""; /// destination for result file - if empty, keep original
std::string redirectStdout = ""; /// destination for the cout/cerr printout
/// from pede - if empty, send to parent
std::string logFileName =
""; /// destination for the log file - if empty, keep original
std::string histoFileName =
""; /// destination for the histogram file - if empty, keep original
std::string evFileName =
""; /// destination for the eigenvector file - if empty, keep original

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the formatting goes a bit wild here. might be better to lift the comments above the variable like

/// steering file with run options
std::string steeringFile = "pedeSteerMaster.txt";

};

/// @brief package the result of the alignment fit
struct mpResult {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
struct mpResult {
struct MpResult {

Comment on lines +22 to +31
#if BOOST_VERSION >= 108800

#include <boost/process/environment.hpp>
#include <boost/process/process.hpp>
#include <boost/process/start_dir.hpp>
#include <boost/process/stdio.hpp>

#else
#include <boost/process.hpp>
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we support both versions?

std::filesystem::path m_path{};
};

#if BOOST_VERSION >= 108800

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively we could split this into two headers and put them into the source file, including them depending on the boost version

Comment on lines +152 to +164
// determine where the user wishes to run
std::filesystem::path workDir = std::filesystem::current_path();

if (!runDir.empty()) {
workDir = runDir;
}
if (!std::filesystem::exists(workDir)) {
std::error_code e;
std::filesystem::create_directories(workDir, e);
if (e) {
return ActsPlugins::ActsToMille::childProcessStatus::failedWorkDir;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be fair to have the workDir as an input and as a precondition that it exists

ActsPlugins::ActsToMille::runChildProcess(
const std::string& program, const std::vector<std::string>& args,
const std::filesystem::path& runDir,
const std::filesystem::path& output_dest) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const std::filesystem::path& output_dest) {
const std::filesystem::path& outputDest) {

childProcessStatus runChildProcess(
const std::string& program, const std::vector<std::string>& args,
const std::filesystem::path& runDir = "",
const std::filesystem::path& output_dest = "");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const std::filesystem::path& output_dest = "");
const std::filesystem::path& outputDest = "");

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Plugins Affects one or more Plugins Infrastructure Changes to build tools, continous integration, ... Public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants